package com.itheima.zy;

import java.util.Scanner;

public class Test13 {
    public static void main(String[] args) {

        //需求：请键盘输入五个整数数据，分别计算他们的，最大值，最小值，数据和，平均值。
        int[] num = new int[10];
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < num.length; i++) {
            System.out.println("第"+(i+1)+"数据");
            num[i] = sc.nextInt();
        }
        int sum = 0;
        int max = num[0];
        int min = num[0];
        for (int i = 1; i < num.length; i++) {
            sum += num[i];
            if (num[i] > max) {
                max = num[i];
            }else if (num[i] < min) {
                min = num[i];
            }
        }
        System.out.println("最大值："+max);
        System.out.println("最小值："+min);
        System.out.println("总和值："+sum);
        System.out.println("平均值："+sum/num.length);



    }
}
